<template>
  <div>
    <ul>
      <li v-for="v in list" :key="v.id">
        <dl>
          <dt><img :src="v.url" alt="" /></dt>
          <dd>
            <p>{{ v.title }}</p>
          </dd>
        </dl>
      </li>
    </ul>
  </div>
</template>

<script>
import { getList } from "../api";
export default {
  name: 'Home',
  data() {
    return {
      list: []
    };
  },
  created() {
    console.log("created 生命周期执行了");
    getList().then(resp => {
      this.list = resp.data.data;
    });
  },
  activated() {
    console.log(' activated-----Home 组件正在被使用');
  },
  deactivated() {
    console.log(' deactivated-----Home 组件正在被失活');

  }
};
</script>

<style>
</style>